import http from '@/utils/http/index'

interface LoginSuccess {
  token: string;
  lv: string;
  alias: string;
}

// 用户登录
export const userLogin = (data: any): Promise<LoginSuccess> => {
  return http.post('login', data)
}

interface RouterMeta {
  showLink: boolean;
  icon: string;
  title: string;
  rank: number
}

export interface RouterNode {
  id: string
  path: string;
  name: string;
  redirect: string;
  meta: RouterMeta;
  children: RouterNode[];
}

export interface RouterResult {
  code: number;
  info: RouterNode[];
}
// 获取路由
export const getRouters = (): Promise<RouterResult> => {
  return http.post('user/getRoutes')
}

///////// 首页 /////
// 首页卡片
export interface CardT {
  id: string
  enabled: boolean
  svg: string
  label: string
  name: string
  description: string
  uri: string
}
